package com.custom.custapi.config;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.custom.custapi.service.CustUpdateBatch;
import com.custom.custapi.service.CustomInsertBatch;

import java.util.List;

/**
 * @author zl
 * @version 1.0
 * @description
 * @date 2025/1/1 1:1
 */
public class MysqlInjector extends DefaultSqlInjector {
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methods = super.getMethodList(mapperClass, tableInfo);
        // 自定义的insert SQL注入器
        methods.add(new CustomInsertBatch());
//        // 自定义的update SQL注入器，参数需要与RootMapper的批量update名称一致
        methods.add(new CustUpdateBatch("updateBatch"));
        return methods;
    }
}